﻿@model IEnumerable<GdHotel.Data.Email>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Создать", "Create")
</p>

@if (Model.Count() > 0)
{
    var first = Model.FirstOrDefault();
    <table>
        <tr>
            <th>
                @Html.LabelFor(model => first.Address)
            </th>
            <th></th>
        </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Address)
            </td>
            <td>
                @Html.ActionLink("Редактировать", "Edit", new { id = item.Id }) |
                @Html.ActionLink("Просмотр", "Details", new { id = item.Id }) |
                @Html.ActionLink("Удалить", "Delete", new { id = item.Id })
            </td>
        </tr>
    }

    </table>
}